package com.clss.commandhelper.tools;

import android.util.Log;

/**
 * Log工具类，控制是否打印日志
 * Created by LiuV on 2017/6/13.
 */

public class Lg {

    public static final int VERBOSE = 1;

    public static final int DEBUG = 2;

    public static final int INFO = 3;

    public static final int WARN = 4;

    public static final int ERROR = 5;

    public static final int NOTHING = 6;

    public static final int LEVEL = 0;

    private static boolean isShow(){
        return true;
//        return BuildConfig.DEBUG;
    }

    public static void v(String tag, String msg) {
        if (LEVEL <= VERBOSE && isShow()) {
            Log.v(tag, msg);
        }
    }

    public static void d(String tag, String msg) {
        if (LEVEL <= DEBUG && isShow()) {
            Log.d(tag, msg);
        }
    }

    public static void i(String tag, String msg) {
        if (LEVEL <= INFO && isShow()) {
            Log.i(tag, msg);
        }
    }

    public static void w(String tag, String msg) {
        if (LEVEL <= WARN && isShow()) {
            Log.w(tag, msg);
        }
    }

    public static void e(String tag, String msg) {
        if (LEVEL <= ERROR && isShow()) {
            Log.e(tag, msg);
        }
    }
}
